package com.emcom.gotour.mvc.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.emcom.gotour.mvc.message.ManageViewMessage;
import com.emcom.gotour.mvc.message.NavigationMessage;
import com.emcom.gotour.mvc.view.ManageView;
import com.emcom.gotour.mvc.view.NavigationView;

@Controller
public class ManageController {

	@Autowired
	private MessageSource messageSource;

	@RequestMapping(value={"/admin/manage.html"})
	public String manage(HttpServletRequest request) {
		ManageView view = new ManageView();
		view.setTitle(ManageViewMessage.Title.value(request, messageSource));
		view.setCategoryManage(NavigationMessage.Category.value(request, messageSource));
		view.setTourManage(NavigationMessage.Tour.value(request, messageSource));
		view.setNavigationView(new NavigationView(request, messageSource));
		request.setAttribute("view", view);
		return "/admin/manage";
	}

}
